#include "Xml.hpp"

namespace sl
{
	pugi::xml_node* LoadFromFile(const std::string& filename)
	{
		pugi::xml_document* doc = new pugi::xml_document();
		pugi::xml_parse_result result = doc->load_file(filename.c_str());

		if (result.status != pugi::xml_parse_status::status_ok)
		{
			std::cout << result.description() << " " << filename << std::cout;
			return NULL;
		}

		return doc;
	}

	bool SaveToFile(pugi::xml_node* node, const std::string& filename)
	{
		return static_cast<pugi::xml_document&>(node->root()).save_file(filename.c_str());
	}
}